//
//  LXTool.m
//  cat
//
//  Created by imera on 16/3/25.
//  Copyright © 2016年 LX. All rights reserved.
//  工具对象

#import "LXTool.h"
#import "AFNetworking.h"

@implementation LXTool

#pragma mark - 获取用户信息
- (LXUser *)getUserInfo
{
    AFHTTPRequestOperationManager *mgr = [AFHTTPRequestOperationManager manager];
    NSString *url = @"http://cat666.com/cat666-interface/index.php/index/check";
    NSString *userName = [[NSUserDefaults standardUserDefaults]objectForKey:@"userName"];
    NSString *password = [[NSUserDefaults standardUserDefaults]objectForKey:@"password"];
    LXUser *user = [[LXUser alloc]init];
    [mgr POST:url parameters:@{@"user":userName,@"password":password} success:^(AFHTTPRequestOperation *operation, id response) {
        NSDictionary *dict = response;
        if (dict.allKeys.count == 1) {
//            return user;
        }else{
//            user = [LXUser initWithDict:dict];
//            return user;
        }
    } failure:^(AFHTTPRequestOperation * operation, NSError * error) {
//        return user;
    }];
    return user;
}


@end
